<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/struts/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>PIM - Personal Information Management System</title>
<link href="style/2_col_rounded.css" media="all" rel="stylesheet" />
<link href="style/drop_down_menus.css" media="all" rel="stylesheet" />
<link href="style/text_n_colors.css" media="all" rel="stylesheet" />
<link href="style/home.css" media="all" rel="stylesheet" />
<link href="style/alternative.css" media="all" rel="stylesheet" />
<!-- for DWR -->
<script type='text/javascript' src='dwr/interface/DWRService.js'></script>
<script type='text/javascript' src='dwr/engine.js'></script>
<script type='text/javascript' src='dwr/util.js'></script>

<script type="text/javascript"  src="script/niftycube.js"></script>
<script type="text/javascript">
	var onDataFound = function(data) {
	    var msg = "";
	    for(var i=0;i<data.length;i++) {  
	        msg = msg + "<li><a href='" + data[i]['moduleLink'];
	        msg = msg + "'>" + data[i]['description'] + "</a>";
	    }

	    document.getElementById("leftMenuDiv").innerHTML = "<ul>" + msg + "</ul>";
	}

	function initiate() {
		var uid = "" + "${sess_user.userID}";
	    DWRService.getFavoriteModules(uid, onDataFound);
	}
	
	//YAHOO.util.Event.onDOMReady(initiate);

    window.onload = function(){
    	initiate();
		Nifty('div#header','transparent medium'); // medium rounded corners w/transparency for gradient background image
		Nifty('div#nav,div#content','medium same-height'); //medium rounded corners, same height cols
		Nifty('div#main_wrapper,div#footer','medium');  //medium rounded corners
		AddCss ("style/niftyCorners.css"); // location of Nifty CSS file relative to this page
		
	}
</script>

<style type="text/css">
body {
	margin: 0;
	padding: 0;
	background: #1d1d1d;
	font-family: "Lucida Grande", Verdana, sans-serif;
	font-size: 100%;
}
table {
    width:98%;
    border: 1px solid #BA9;

}
th {
    padding: .3em .1em .3em .1em;
    border-bottom:2px solid #069;
    background-color: #69c;
    color:#cccc8f;
}
#headbox {
    font-size: 0.7em;
    color:#FFF;
    text-align:right;
    padding: 20pt 20pt 0pt 10pt
}
#headbox a{
    color:#FFF;
}

#leftMenuDiv {  
    padding: 2pt 2pt 2pt 1pt;
    font-size: 1em;
    line-height:1.5em;
    height:20em;
}

#leftMenuDiv ul {  
    list-style-type: inherit;
    list-style-image: url(images/col.gif);
    list-style-position: inside;
}
#leftMenuDiv ul li { 
    padding-left:3px;
}
</style>

<decorator:head />
</head>

<body class="lime">
<div id="main_wrapper">
<div id="header">
	<div id="header_inner">
		<h1><A HREF="http://localhost:1975/pims" style="color:white">个人信息管理系统</A> 
		Personal Information Management System 1.0</h1> 
		<div id="headbox">欢迎&nbsp;&nbsp;${sess_user.userName}&nbsp;&nbsp; 
( <c:choose>
 <c:when test="${empty sess_user}">
<a href="#" onClick="javascript:window.parent.location.href='login.htm'">登录</a>
 </c:when>
<c:otherwise>
<a href="#" onClick="javascript:window.parent.location.href='logout.htm'">退出</a>
</c:otherwise>
</c:choose>
&nbsp;| <a href="#" onClick="javascript:window.parent.location.href='about.htm'">关于</a> 
&nbsp;| <a href="#" onClick="javascript:window.parent.location.href='help.htm'">帮助</a> 

) </div>
</div><!-- end header_inner -->
<div id="drop_down_menus">
<ul>
<c:forEach items="${sess_user.role.moduleList}" var="module" varStatus="moduleNum">
<c:if test="${module.moduleStatus >0 || sess_user.role.roleID == 1}">
<li><a href="${module.moduleLink}">
${module.description}</a> 
</c:if>
<ul>
<c:forEach items="${module.subModuleList}" var="subModule" varStatus="subModuleNum">
<c:if test="${subModule.moduleStatus >0 || sess_user.role.roleID == 1}">
<li>
<a href="${subModule.moduleLink}" title="${subModule.moduleID}. ${subModule.description} ${subModule.moduleStatus}">
 ${subModule.description}</a>
</c:if>
</c:forEach>
</ul>
</c:forEach>
</ul>
</div>
<div style="clear:both"></div>
</div><!-- end header -->
<div id="nav">
<div id="nav_inner">
<div id = "leftMenuDiv">

</div>
</div>
<!-- end nav_inner -->
</div><!-- end nav -->
<decorator:body />
<div id="footer">
	 <div id="footer_inner">
      <p>Copyright &copy; 2009-2010 <a href="http://localhost:1975"><em>Walter Fan</em></a> all rights reserved. </p>
    </div><!-- end footer_inner -->
</div><!-- end footer -->

</div><!--end main wrapper-->

</body>
</html>
